package org.springblade.modules.admin.controller.feishu;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.modules.admin.entity.UserExt;
import org.springblade.modules.admin.service.UserExtService;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: Sharry
 * @createTime: 2025-02-26 8:47
 * @version: Version-1.0
 */
@RestController
@AllArgsConstructor
@RequestMapping("/admin/lark/user-id")
public class LarkUserIdController {

	private final UserExtService userExtService;

	/**
	 * 正式环境执行初始化人员id
	 * 正式环境PostMan触发地址
	 * @link https://admin.sida-tech.com/api/admin/lark/user-id/initialization
	 * @return 是否成功
	 */
	@RequestMapping("/initialization")
	@ApiOperation(value = "初始化飞书用户ID", notes = "初始化飞书用户ID")
	@ApiOperationSupport(order = 1)
	@Transactional(rollbackFor = Exception.class)
	public boolean initialization() {
		// 根据userId列表查询用户ext信息
		List<UserExt> updateList = new ArrayList<>();
		// 苏志豪 1411851718204899330
		UserExt SuZhiHao = userExtService.getById(1411851718204899330L);
		SuZhiHao.setLarkUserId("abf43812");
		updateList.add(SuZhiHao);
		// 林川雄 1411853653347713026
		UserExt LinChuanXiong = userExtService.getById(1411853653347713026L);
		LinChuanXiong.setLarkUserId("aef5cgcc");
		updateList.add(LinChuanXiong);
		// 孟停伟 1421021237083160578
		UserExt MengTingWei = userExtService.getById(1421021237083160578L);
		MengTingWei.setLarkUserId("c9e7bd78");
		updateList.add(MengTingWei);
		// 梁汇生 1433713226199121921
		UserExt LiangHuiSheng = userExtService.getById(1433713226199121921L);
		LiangHuiSheng.setLarkUserId("de475g26");
		updateList.add(LiangHuiSheng);
		// 张佳维 1443518134167322626
		UserExt ZhangJiaWei = userExtService.getById(1443518134167322626L);
		ZhangJiaWei.setLarkUserId("1ee33422");
		updateList.add(ZhangJiaWei);
		// 张志勇 1443518577056464898
		UserExt ZhangZhiYong = userExtService.getById(1443518577056464898L);
		ZhangZhiYong.setLarkUserId("c89535gc");
		updateList.add(ZhangZhiYong);
		// 王忠华 1452547866972176385
		UserExt WangZhongHua = userExtService.getById(1452547866972176385L);
		WangZhongHua.setLarkUserId("3g348197");
		updateList.add(WangZhongHua);
		// 周霖 1572156367145373697
		UserExt ZhouLin = userExtService.getById(1572156367145373697L);
		ZhouLin.setLarkUserId("ecd34ea1");
		updateList.add(ZhouLin);
		// 马志兴 1634380792694562817
		UserExt MaZhiXing = userExtService.getById(1634380792694562817L);
		MaZhiXing.setLarkUserId("e3334dae");
		updateList.add(MaZhiXing);
		// 梁艺聪 1772098463364603905
		UserExt LiangYiChong = userExtService.getById(1772098463364603905L);
		LiangYiChong.setLarkUserId("1787bg8g");
		updateList.add(LiangYiChong);
		// 陈潮伟 1787681033056411650
		UserExt ChenChaoWei = userExtService.getById(1787681033056411650L);
		ChenChaoWei.setLarkUserId("9bb4f842");
		updateList.add(ChenChaoWei);
		// 严朝锋 1790935313357139969
		UserExt YanChaoFeng = userExtService.getById(1790935313357139969L);
		YanChaoFeng.setLarkUserId("2g28ed7c");
		updateList.add(YanChaoFeng);
		// 李志坚 1793195152387473410
		UserExt LiZhiJian = userExtService.getById(1793195152387473410L);
		LiZhiJian.setLarkUserId("96b72788");
		updateList.add(LiZhiJian);
		// 王家辉 1805143506936381441
		UserExt WangJiaHui = userExtService.getById(1805143506936381441L);
		WangJiaHui.setLarkUserId("4ef27698");
		updateList.add(WangJiaHui);
		// 黄嘉明 1836238361617276930
		UserExt HuangJiaMing = userExtService.getById(1836238361617276930L);
		HuangJiaMing.setLarkUserId("9f162fc3");
		updateList.add(HuangJiaMing);
		// 解青山 1840236468006682625
		UserExt XinQingShan = userExtService.getById(1840236468006682625L);
		XinQingShan.setLarkUserId("a77745ag");
		updateList.add(XinQingShan);
		// 陈子杰 1851470094591631362
		UserExt ChenZiJie = userExtService.getById(1851470094591631362L);
		ChenZiJie.setLarkUserId("g2bg5715");
		updateList.add(ChenZiJie);
		// 张明锋 1858745512911753217
		UserExt ZhangMingFeng = userExtService.getById(1858745512911753217L);
		ZhangMingFeng.setLarkUserId("fc1fe4gd");
		updateList.add(ZhangMingFeng);
		// 李秋杰 1869208623900839937
		UserExt LiQiuJie = userExtService.getById(1869208623900839937L);
		LiQiuJie.setLarkUserId("51ga9f13");
		updateList.add(LiQiuJie);

		return userExtService.updateBatchById(updateList);
	}

}
